
#ifndef _VHAND_HAND_H
#define _VHAND_HAND_H

//---------------------------------------------------------------------------
//  Includes
//---------------------------------------------------------------------------

#include "HandConfig.h"
#include "Armature.h"
#include "SphereFilledBody.h"

namespace vhand
{

//***************************************************************************
//                                Hand
//***************************************************************************

/** 
 */

class Hand
{
public:

    Hand();
    ~Hand();

    const Geometry* getBonesGeom() const { return &_bones_geom; }
    Geometry* editBonesGeom() { return &_bones_geom; }
    const Geometry* getSkinGeom() const { return &_skin_geom; }
    Geometry* editSkinGeom() { return &_skin_geom; }
    const Armature* getArmature() const { return &_armature; }
    Armature* editArmature() { return &_armature; }
    const SphereFilledBody* getSphereFilledBody() const { return &_volumehandle; }
    SphereFilledBody* editSphereFilledBody() { return &_volumehandle; }

    void initHost( void );
    void initDevice( bool main_memory_preserve = true );
    void draw( void ) const;
    void moveLimb( std::string limbname, const Matrix4 &limbmat );
    void simulation();
    void updateGeometry();

    void setSkinTransparency( float alpha ) { _skin_geom.setTransparency( alpha ); }
    void setBonesTransparency( float alpha ) { _bones_geom.setTransparency( alpha ); }

    /**
     *
     * @care public member variables, naming rules: no '_' prefix
     */
    bool drawSkin() const { return _drawSkin; }
    void drawSkin( bool ds ) { _drawSkin = ds; }
    bool drawBones() const { return _drawBones; }
    bool drawBones( bool db ) { _drawBones = db; }
    bool drawVolume() const { return _drawVolume; }
    bool drawVolume( bool dv ) { _drawVolume = dv; }

private:

    /**
     */
    Geometry _bones_geom;

    /**
     */
    Geometry _skin_geom;

    /** 
     */
    Armature _armature;

    /**
     */
    SphereFilledBody _volumehandle;

    /** 
     */
    bool _drawSkin;
    bool _drawBones;
    bool _drawVolume;

}; // class Hand

} // namespace vhand

#endif // _VHAND_HAND_H
